package vector;

public class Vector2D extends Vector {
	private double x;
	private double y;
	private double r;
	private double theta;
	
	public Vector2D(double x, double y){
		this.x = x;
		this.y = y;
		this.r = Math.sqrt(x * x + y * y);
		this.theta = Math.atan(y/x);
	}
	
	public double getX(){
		return x;
	}
	
	public double getY(){
		return y;
	}
	
	public double getR(){
		return r;
	}
	
	public double getTheta(){
		return theta;
	}
	
	public Vector2D add(Vector2D b){
		return new Vector2D(x + b.getX(), y + b.getY());
	}
	
	public double dotProduct(Vector2D b){
		return x*b.getX() + y*b.getY();
	}
	
	public Vector2D crossProduct(Vector2D b){
		return null;
	}
	
	public double mag(){
		return Math.sqrt(x*x + y*y);
	}
	
	
}
